<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="UTF-8">
  <title>JavaScript 字符串方法</title>
</head>
<body>
<h2>提取字符串字符-charCodeAt() 方法</h2>
<p>charCodeAt() 方法返回字符串中指定索引的字符 unicode 编码：</p>

<p id="demo"></p>

<script>
  var str = "HELLO WORLD";
  document.getElementById("demo").innerHTML = str.charCodeAt(0);
</script>

</body>
</html>

<!--输出结果：72-->